﻿			
//人物
function createPlayer01(){
			var player = new sprite("max");
	    	
	    	player.imgs = new Array();
	    	
	    	for (var i =0 ;i<8;i++){player.imgs[i] = new Array(); }
	    	
	    	createAnima(player.imgs[CONST_RIGHT], "/RPG/sucai/char01/66-",".png",8,true);
	    	createAnima(player.imgs[CONST_LEFT],  "/RPG/sucai/char01/69-",".png",8,true);
	    	createAnima(player.imgs[CONST_DOWN], "/RPG/sucai/char01/67-",".png",8,true);
	    	createAnima(player.imgs[CONST_UP], "/RPG/sucai/char01/68-",".png",8,true);
	    	createAnima(player.imgs[CONST_RIGHT_DOWN], "/RPG/sucai/char01/62-",".png",8,true);
	    	createAnima(player.imgs[CONST_LEFT_DOWN], "/RPG/sucai/char01/61-",".png",8,true);
	    	createAnima(player.imgs[CONST_RIGHT_UP], "/RPG/sucai/char01/64-",".png",8,true);
	    	createAnima(player.imgs[CONST_LEFT_UP], "/RPG/sucai/char01/63-",".png",8,true);
	    	
	    	player.properties.put("hp",200);
	    	player.properties.put("q",160);
	    	player.properties.put("exp",2000);
	    	
	    	player.properties.put("jin",90);
	    	player.properties.put("mu",50);
	    	player.properties.put("shui",100);
	    	player.properties.put("huo",50);
	    	player.properties.put("tu",50);
	    	return player;
}
/*
 * 
 * 必须，此函数为游戏的人物属性系统
 * 
 * 
 * */
function SpriteProSystem(strpro,player){
	var jin = player.properties.get("jin");
	var mu = player.properties.get("mu");
	var shui = player.properties.get("shui");
	var huo = player.properties.get("huo");
	var tu = player.properties.get("tu");
	var exp = player.properties.get("exp");
	
	switch (strpro){
	case "lvl":
		return exp/200; //todo quzheng
	break;
	case "maxHp": //最大生命
		return huo + tu + mu + shui;
	break;
	
	case "maxQ": //最大气
		return mu + shui;
	break;
	
	case "gongji":
		return jin + huo;
	break;
	
	case "fangshou":
		return tu + jin;
	break;
	}
	
	return -1;
	
	
}

/*
function Initpros(sprite){
	sprite.properties.put("命",0);
	sprite.properties.put("气",0);
	
	sprite.properties.put("攻击",0);
	sprite.properties.put("防守",0);
	
	sprite.properties.put("金",0);
	sprite.properties.put("木",0);
	sprite.properties.put("水",0);
	sprite.properties.put("火",0);
	sprite.properties.put("土",0);
	
	
}*/
